package com.yunhe.common.model.device;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * 点表对象
 * @desc 点表对象定义
 * @author liuronglei
 */
public class Analog implements Comparable<Analog> {

    private Long id;
    private String title;
    private Long deviceId;
    private Long typeId;
    private String typeName;
    private String typeTitle;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pointNumber;
    private Double transformRatio = 1D;
    private Long sn;
    private Long terminalId;
    private String terminalTitle;
    private String terminalName;
    private String formula;
    private String calcPosition;
    private String signalTitle;
    private Boolean needStorage;
    private String unit;

    @Override
    public int compareTo(Analog o) {
        if (o == null) {
            return 1;
        }
        if (this.sn == null) {
            return -1;
        } else if (o.getSn() == null) {
            return 1;
        }
        return this.sn.compareTo(o.getSn());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Long getPointNumber() {
        return pointNumber;
    }

    public void setPointNumber(Long pointNumber) {
        this.pointNumber = pointNumber;
    }

    public Double getTransformRatio() {
        return transformRatio;
    }

    public void setTransformRatio(Double transformRatio) {
        this.transformRatio = transformRatio;
    }

    public Long getSn() {
        return sn;
    }

    public void setSn(Long sn) {
        this.sn = sn;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public String getCalcPosition() {
        return calcPosition;
    }

    public void setCalcPosition(String calcPosition) {
        this.calcPosition = calcPosition;
    }

    public String getSignalTitle() {
        return signalTitle;
    }

    public void setSignalTitle(String signalTitle) {
        this.signalTitle = signalTitle;
    }

    public String getTypeTitle() {
        return typeTitle;
    }

    public void setTypeTitle(String typeTitle) {
        this.typeTitle = typeTitle;
    }

    public Long getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(Long terminalId) {
        this.terminalId = terminalId;
    }

    public String getTerminalTitle() {
        return terminalTitle;
    }

    public void setTerminalTitle(String terminalTitle) {
        this.terminalTitle = terminalTitle;
    }

    public String getTerminalName() {
        return terminalName;
    }

    public void setTerminalName(String terminalName) {
        this.terminalName = terminalName;
    }

    public Boolean getNeedStorage() {
        return needStorage;
    }

    public void setNeedStorage(Boolean needStorage) {
        this.needStorage = needStorage;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }
}
